// pages/user/index.js
Page({
  data: {
    userInfo: {},
    collectNums: 0
  },
  onShow() {
    const userInfo = wx.getStorageSync('userinfo')
    const collect = wx.getStorageSync('collect')||[]

       

     this.setData({ userInfo, collectNums: collect.length }) 
  }
})